import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { TaskSystemTaskInfoEntity } from '../../entity/task_info'; 
import { TaskSystemTaskInfoService } from '../../service/task_info'; 

/**
 * tasksystem模块-任务信息
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: TaskSystemTaskInfoEntity,
  service: TaskSystemTaskInfoService,
  pageQueryOp: {
    keyWordLikeFields: ['title', 'sender', 'receiver'],
    fieldEq: ['type', 'status', 'priority'],
  }
})
export class AdminTaskSystemTaskInfoController extends BaseController {
    @Inject()
    taskSystemTaskInfoService: TaskSystemTaskInfoService;

    @Post('/detail', { summary: '获取任务详情' })
    async detail(@Body('id') id: number) {
        return this.ok(await this.taskSystemTaskInfoService.info(id));
    }
}
